﻿CREATE TABLE [dbo].[UserInRoles] (
    [UserID] INT NOT NULL,
    [RoleID] INT NOT NULL,
    PRIMARY KEY CLUSTERED ([UserID] ASC, [RoleID] ASC),
    CONSTRAINT [FK_user_in_role_roles] FOREIGN KEY ([RoleID]) REFERENCES [dbo].[Roles] ([ID]) ON DELETE CASCADE,
    CONSTRAINT [FK_user_in_role_users] FOREIGN KEY ([UserID]) REFERENCES [dbo].[Users] ([ID]) ON DELETE CASCADE
);

